package com.itheima.em.server.service.impl.tianditu;

import cn.hutool.http.HttpRequest;
import com.itheima.em.config.TMapServerConfig;
import com.itheima.em.service.impl.BaseMapApiService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

@Service
@ConditionalOnBean(TMapServerConfig.class)
public class TMapWebApiService extends BaseMapApiService {

    @Resource
    private TMapServerConfig tMapServerConfig;

    @Override
    public void setRequestParam(HttpRequest httpRequest, Map<String, Object> param) {
        httpRequest.form(param)
                .form("tk", this.tMapServerConfig.getBrowser().getAk());
    }

}
